home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 23.zip / BS1 part 23 / Prof page II type.adf / Install / InsFont < prev    next >
AmigaDOS Script File  |  1990-08-10  |  2KB  |  52 lines

  1. .KEY fontName/A,fontDir/A
  2. .BRA {
  3. .KET }
  4.  
  5. ; Install a font (family).  fontName is the name we show the user.
  6. ; fontDir is the pathname of the directory where the font can be found.
  7. ; The font will be installed to GD_Dest:.
  8. ;
  9. ; If there is room in GD_Dest: for the font, we ask the user whether it
  10. ; should be installed.
  11.  
  12.     ;instutil >GD_TempDir:free freespace GD_Dest:
  13.     instutil >GD_TempDir:size dirsize {fontDir}
  14.     ;instutil -eGDIFREE join GD_TempDir:free
  15.     instutil -eGDISIZE join GD_TempDir:size
  16.  
  17.     echo " "
  18.     echo noline "   {fontName} ("
  19.     copy ENV:GDISIZE *                 ; TYPE without the trailing newline
  20.     echo " disk blocks):"
  21.  
  22.     ; We want to leave one block free, but the size we'll occupy is actually
  23.     ; GDISIZE-1 (since the source includes a directory which won't
  24.     ; be created).  These two off-by-one's cancel.
  25.  
  26.     if val $GDISIZE gt $GDIFREE
  27.         echo "*E[;33m        Not enough disk space available.*E[m"
  28.         skip InsExit
  29.     endif
  30.  
  31.  
  32.     instutil ask -dy "     Install [Y/N]? Y"
  33.     if warn
  34.         echo "        {fontName} not installed"
  35.         skip InsExit
  36.     endif
  37.  
  38.  
  39.     ; We've passed all the hurdles -- install the thing.
  40.  
  41.     failat 21
  42.     echo "        Installing {fontName}"
  43.  
  44.     execute GD_SourceDisk:Install/RamCopy {fontDir} GD_Dest: "        {fontName}" "installed"
  45.  
  46.     ; Since GD_Dest: has (potentially) changed, update the free-space count.
  47.     instutil >GD_TempDir:free freespace GD_Dest:
  48.     instutil -eGDIFREE join GD_TempDir:free
  49.  
  50. lab InsExit
  51.     failat 10
  52.